package com.lyxedu.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lyxedu.common.Result;
import com.lyxedu.pojo.Dict;
import com.lyxedu.services.DictService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/dict")
public class DictController {
    @Resource
    private DictService dictService;

    @GetMapping("/list")
    public Result dictList(){
        LambdaQueryWrapper<Dict> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Dict::getType,"icon");
        List<Dict> list = dictService.list(wrapper);
        return Result.success(list);
    }
}
